<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增项目里程碑')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-milestone-add">
        	<input name="gcProjectid" type="hidden" th:value="${gcProject.id}" >
            <input name="pId" type="hidden" th:value="${sjProjectMilestone.id}" >
            <div class="form-group"> 
                <label class="col-sm-2 control-label is-required">项目名称：</label>
                <div class="col-sm-4">
                	<input name="gcProjectName" class="form-control" type="text" th:value="${gcProject.name}" readonly="readonly" autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">任务号：</label>
                <div class="col-sm-4">
                    <input name="orderNo" class="form-control" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">任务名称：</label>
                <div class="col-sm-4">
                    <input name="name" class="form-control" type="text" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">工作日：</label>
                <div class="col-sm-4">
                    <input name="count" class="form-control" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">   
            	<label class="col-sm-2 control-label is-required">计划开始：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="pstartAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div> 
                <label class="col-sm-2 control-label is-required">计划结束：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="pendAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
                
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">实际开始日期：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="sstartAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
                <label class="col-sm-2 control-label is-required">实际结束日期：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="sendAt" class="form-control" placeholder="yyyy-MM-dd" type="text" required autoComplete="off">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">进度百分比(%)：</label>
                <div class="col-sm-4">
                    <input name="jdbfb" class="form-control" type="text" required autoComplete="off">
                </div>
                <label class="col-sm-2 control-label is-required">负责人：</label>
                <div class="col-sm-4">
                    <select name="ownerId" class="form-control" required>
						<option th:each="po:${peoplelis}" th:value="${po.code}" th:text="${po.name}"></option>
					</select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">排序：</label>
                <div class="col-sm-4">
                    <input name="sort" class="form-control" type="text" required autoComplete="off">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">描述：</label>
                <div class="col-sm-10">
                    <textarea name="descs" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "sj/milestone"
        $("#form-milestone-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.saveTab(prefix + "/add", $('#form-milestone-add').serialize());
            }
        }

        $("input[name='pstartAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='pendAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='sstartAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='sendAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

    </script>
</body>
</html>